package Koneksi;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

public class pesan {

    private String kode, jumlah;

    public String getKode() {
        return kode;
    }

    public void setKode(String kode) {
        this.kode = kode;
    }

    public String getJumlah() {
        return jumlah;
    }

    public void setJumlah(String jumlah) {
        this.jumlah = jumlah;
    }

    public List tampil() throws SQLException {
        List pesan = new ArrayList();
        Connection con = Koneksi.open();
        String ret = "SELECT * FROM PESANAN_O";
        Statement st = con.createStatement();
        ResultSet rs = st.executeQuery(ret);
        while (rs.next()) {
            pesan s = new pesan();
            s.setKode(rs.getString("kode"));
            s.setJumlah(rs.getString("jumlah"));
            pesan.add(s);
        }
        con.commit();
        return pesan;
    }
}
